<template>
  <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
    <van-swipe-item v-for="(item, idx) in swipe" :key="idx">
      <div class="header-img">
        <nuxt-link :to="'/product?pid='+item.product_id"><img :src="item.img" class="w100vw"></nuxt-link>
      </div>
    </van-swipe-item>
  </van-swipe>
</template>

<script>
  export default {
    data () {
      return {
        swipe: []
      }
    },
    async created () {
      const { status, data } = await this.$axiosApi.getIndexSwipe()
      if (status === 200 && data.code === 0) {
        this.swipe = data.data
      }
    }
  }
</script>

<style scoped lang="stylus">

</style>
